<!--  -->
<template>
  <div class="home">
    <!-- 1、头部卡片统计信息 -->
    <div class="homeHeader">
      <div class="item">
        总订单量
        <div class="num">75615，244</div>
        <div class="bottom">今日订单：3,4565</div>
      </div>
      <div class="item">
        总销售额
        <div class="num">75615，244￥</div>
        <div class="bottom">今日销售额：3,4565￥</div>
      </div>
      <div class="item">
        总广告量
        <div class="num">75615，244</div>
        <div class="bottom">今日广告：3,4565</div>
      </div>
      <div class="item">
        访问量
        <div class="num">75615，244</div>
        <div class="bottom">今日访问量：3,4565</div>
      </div>
    </div>
    <!-- 2、访问数据统计信息 -->
    <div class="homeMiddle">
      <div class="Statistical">
        <div class="title">月销售额</div>
        <div id = "main" style = "width: 100%;height:100%;" ></div>
      </div>
      <div class="Statistical">

        <div class="dateTime">
          <calendar></calendar>
        </div>
      </div>
    </div>
    <!--  3、最新内容 -->
    <div class="homeFoot">
      <div class="boxCard" >
        <div class="clearfix">
          <span>今日订单</span>
        </div>
        <div class="text-item">
          <el-row :gutter="20">
            <el-col :span="8">
              <div class="">衣服：11</div>
            </el-col>
            <el-col :span="8">
              <div class="">裤子：222</div>
            </el-col>
            <el-col :span="8">
              <div class="">袜子：3333</div>
            </el-col>
          </el-row>
        </div>
      </div>
      <div class="boxCard" >
        <div class="clearfix">
          <span>本月订单</span>
        </div>
        <div class="text-item">
          <el-row :gutter="20">
            <el-col :span="8">
              <div class="">衣服：11</div>
            </el-col>
            <el-col :span="8">
              <div class="">裤子：222</div>
            </el-col>
            <el-col :span="8">
              <div class="">袜子：3333</div>
            </el-col>
          </el-row>
        </div>
      </div>
      <div class="boxCard">
        <div class="clearfix">
          <span>快捷入口</span>
        </div>
        <div class="text-item">
          <el-row>
            <el-tooltip content="搜索" placement="top">
              <el-button icon="el-icon-search" circle></el-button>
            </el-tooltip>
            <el-tooltip content="编辑" placement="top">
              <el-button type="primary" icon="el-icon-edit" circle></el-button>
            </el-tooltip>
            <el-tooltip content="Top center" placement="top">
              <el-button type="success" icon="el-icon-check" circle></el-button>
            </el-tooltip>
            <el-tooltip content="Top center" placement="top">
              <el-button type="info" icon="el-icon-message" circle></el-button>
            </el-tooltip>
            <el-tooltip content="Top center" placement="top">
              <el-button type="warning" icon="el-icon-star-off" circle></el-button>
            </el-tooltip>
            <el-tooltip content="Top center" placement="top">
              <el-button type="danger" icon="el-icon-delete" circle></el-button>
            </el-tooltip>
          </el-row>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
// 这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
// 例如：import 《组件名称》 from '《组件路径》';
import * as echarts from 'echarts';
import calendar from '../../components/calendar.vue';
export default {
  // import引入的组件需要注入到对象中才能使用
  components: {
    calendar
  },
  data() {
    // 这里存放数据
    return {
      
    }
  },
  // 监听属性 类似于data概念
  computed: {},
  // 监控data中的数据变化
  watch: {},
  // 方法集合
  methods: {

  },
  // 生命周期 - 创建完成（可以访问当前this实例）
  created() {

  },
  // 生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {
    // 基于准备好的dom，初始化echarts实例
var myChart = echarts.init(document.getElementById('main'));
// 绘制图表
myChart.setOption({
  // title: {
  //   text: '产品分类统计'
  // },
  tooltip: {},
  xAxis: {
    data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
  },
  yAxis: {},
  series: [
    {
      name: '销量',
      type: 'bar',
      data: [5, 20, 36, 10, 10, 20]
    }
  ]
});
  },
  beforeCreate() { }, // 生命周期 - 创建之前
  beforeMount() { }, // 生命周期 - 挂载之前
  beforeUpdate() { }, // 生命周期 - 更新之前
  updated() { }, // 生命周期 - 更新之后
  beforeDestroy() { }, // 生命周期 - 销毁之前
  destroyed() { }, // 生命周期 - 销毁完成
  activated() { } // 如果页面有keep-alive缓存功能，这个函数会触发
}
</script>
<style scoped>
.home {
  margin: 10px;
}

.homeHeader {
  /* flex布局 */
  display: flex;
  /* 主轴方向 */
  flex-direction: row;
  padding-right: 30px;
}

.item {
  flex: 1;
  height: 100px;
  padding: 10px;
  background-color: #409EFF;
  border-radius: 10px;
  margin-left: 20px;
  font-weight: bold;
  color: #fff;
  position: relative;
}

.item:nth-child(1){
  background-image: linear-gradient(#b0df7b,#88554d);
}
.item:nth-child(2){
  background-image: linear-gradient(#7ba6df,#236ea0);
}
.item:nth-child(3){
  background-image: linear-gradient(#409EFF,#ad93dd);
}
.num {
  font-size: 22px;
  margin: 10px;
  color: #fff;
}

.bottom {
  position: absolute;
  border-top: 1px solid rgb(264, 245, 245);
  padding: 10px 20px;
  bottom: 0;
  right: 0;
  left: 0;
  color: #fff;
  font-weight: normal;
}

.homeMiddle {
  display: flex;
  margin-top: 20px;
  margin-left: 10px;
}

.Statistical {
  /* flex: 1; */
  padding: 10px;
  width: 822px;
  height: 500px;
  font-weight: bold;
  background-color: #fff;
  border-radius: 10px;
  margin-left: 10px;
  box-shadow: 0px 2px 11px rgba(94, 92, 92, 0.5)
}

.homeFoot {
  display: flex;
  padding: 20px;
  padding: 20px;
  /* justify-content: space-between; */
  /* flex-wrap: wrap;
  align-items: center;
  align-content: space-around; */
}

.boxCard {
  flex: 1;
  height: 150px;
  margin-right: 10px;
  background-color: #fff;
  box-shadow: 0px 2px 11px rgba(94, 92, 92, 0.5)
}



.clearfix{
  padding: 10px;
  font-weight: 600;
}
.text-item {
  margin-top: 10px;
  border-top: 2px solid #f5f5f5;
}
.el-row{
  width: 98%;
  padding-top: 10px;
  padding-left: 20px;
  
}
.el-col{
  border-right: 1px solid red;
}

.el-col:nth-child(3){
  border-right: none;
}
</style>
